/**
 * Created by Administrator on 2017/5/8.
 */
$(function(){
    var aidA;
    followAList();
    function followAList(){
        var token = localStorage.getItem('youyuLoginToken');
        var anchorUrl =FOLLOW_STAR;
        var curTime = new Date().getTime();
        var packParam ={'pageNum':1,'pageSize':10};
        var followList = {
            time: curTime,
            token:token,
            url:anchorUrl,
            param:packParam,
            sign:$.md5('ts='+curTime+'&mn=3&chid=0&version=1.0&token='+token+'&param='+JSON.stringify(packParam)),
            okCallback:function(data){
                console.log(data);
                var datas = data.data;
                if(datas.length>0){
                    $('.noFollow').css('display','none');
                    $('#followed').css('display','block');
                    for(var i in datas){
                        aidA = datas[i].aid;
                    }
                    var followData = document.getElementById('followList').innerHTML;
                    var html = template(followData,data);
                    $('#followed').append(html)
                }else {
                    $('.noFollow').css('display','block');
                    $('#followed').css('display','none');
                }

            },
            errorCallback:function(){
            }
        }
        YY.post(followList)
    }
    /*点击列表*/
    $('.lists').delegate('ul','click',function(){
        var aidA = $(this).attr('data-type');
        window.location.href = 'anchor.html?aid='+aidA;
    })
})